﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CallIn.aspx.cs" Inherits="UI_CallIn" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>来话宝 <%=FTchina.Library.MasterHelper.ClientTitle %>--来电速录</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link href="/images/style.css" rel="Stylesheet" />
    <script language="javascript" type="text/javascript" src="/js/jiazai.js"></script>
    <script src="/js/introbox.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="/js/jquery-1.3.2.min.js"></script>
    <script language="javascript" type="text/javascript" src="/js/pagefunction.js"></script>
    <script language="javascript" type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
    <script language="javascript" type="text/javascript" src="/js/jquery.autocomplete.js"></script>
    <link href="/js/jquery.autocomplete.css" rel="Stylesheet" />
    <script language="javascript" type="text/javascript" src="/js/switchbox/ks-switch.pack.js"></script>
    <link href="/js/switchbox/switch.css" rel="Stylesheet" />
    <script type="text/javascript">


        $(document).ready(function () {
            jQuery.ajaxSetup({ cache: false });

            var _pcount = '0'; //预设一个人数，作为过滤用的全局变量
            var _area = ''; //预设一个区域，作为过滤用的全局变量
            var _candian = 'zhong'; //预设一个午餐，作为过滤用的全局变量
            //姓氏速选
            $("div#namer span").css("cursor", "pointer").click(function () {
                $("#txbcustomerName").val($(this).html());
                MakeSMS();
            })

            //短信模板
            $("div#smstmp input").css("cursor", "pointer").click(function () {
                MakeSMS();
            })







            //自动生成短信
            $("#MakeSMS").click(function () {
                var tel = $("#txbCustomerTel0").val(); //手机
                var cn = $("#txbcustomerName").val(); //客户名称
               

                if (cn.length == 0) {

                    alert("请输入客户姓名");
                }
                if (tel.length == 0) {

                    //$("#ChkSendSms").removeAttr("checked");
                    alert("请输入客户手机号，用于接收短信");

                }

              
                MakeSMS();
            });




        });

        
        ///实时显示
        function MakeSMS() {
            var text = $('input[name="smsactive"]:checked +span ').text();
            var cn = $("#txbcustomerName").val(); //客户名称
            var cs = $('input:radio[name="ddlsex"]:checked').val(); //性别
            var tel = $("#txbCustomerTel0").val(); //手机
            
            //短信样例
            $.get("/ui/makesms.aspx?t=", { tc: text, cn: cn, cs: cs }, function (data) {
                $("#txbSMS").html(data);
            });

             
            
        }
    </script>
    <script type="text/javascript">
        var stockInfoJson = [
	{ name: "王", spell: "wang" },
{ name: "李", spell: "li" },
{ name: "张", spell: "zhang" },
{ name: "刘", spell: "liu" },
{ name: "陈", spell: "chen" },
{ name: "杨", spell: "yang" },
{ name: "黄", spell: "huang" },
{ name: "赵", spell: "zhao" },
{ name: "吴", spell: "wu" },
{ name: "周", spell: "zhou" },
{ name: "徐", spell: "xu" },
{ name: "孙", spell: "sun" },
{ name: "马", spell: "ma" },
{ name: "朱", spell: "zhu" },
{ name: "胡", spell: "hu" },
{ name: "郭", spell: "guo" },
{ name: "何", spell: "he" },
{ name: "高", spell: "gao" },
{ name: "林", spell: "lin" },
{ name: "郑", spell: "zheng" },
{ name: "谢", spell: "xie" },
{ name: "罗", spell: "luo" },
{ name: "梁", spell: "liang" },
{ name: "宋", spell: "song" },
{ name: "唐", spell: "tang" },
{ name: "许", spell: "xu" },
{ name: "韩", spell: "han" },
{ name: "冯", spell: "feng" },
{ name: "邓", spell: "deng" },
{ name: "曹", spell: "cao" },
{ name: "彭", spell: "peng" },
{ name: "曾", spell: "zeng" },
{ name: "肖", spell: "xiao" },
{ name: "田", spell: "tian" },
{ name: "董", spell: "dong" },
{ name: "袁", spell: "yuan" },
{ name: "潘", spell: "pan" },
{ name: "于", spell: "yu" },
{ name: "蒋", spell: "jiang" },
{ name: "蔡", spell: "cai" },
{ name: "余", spell: "yu" },
{ name: "杜", spell: "du" },
{ name: "叶", spell: "ye" },
{ name: "程", spell: "cheng" },
{ name: "苏", spell: "su" },
{ name: "魏", spell: "wei" },
{ name: "吕", spell: "lv" },
{ name: "丁", spell: "ding" },
{ name: "任", spell: "ren" },
{ name: "沈", spell: "shen" },
{ name: "姚", spell: "yao" },
{ name: "卢", spell: "lu" },
{ name: "姜", spell: "jiang" },
{ name: "崔", spell: "cui" },
{ name: "钟", spell: "zhong" },
{ name: "谭", spell: "tan" },
{ name: "陆", spell: "lu" },
{ name: "汪", spell: "wang" },
{ name: "范", spell: "fan" },
{ name: "金", spell: "jin" },
{ name: "石", spell: "shi" },
{ name: "廖", spell: "liao" },
{ name: "贾", spell: "jia" },
{ name: "夏", spell: "xia" },
{ name: "韦", spell: "wei" },
{ name: "付", spell: "fu" },
{ name: "方", spell: "fang" },
{ name: "白", spell: "bai" },
{ name: "邹", spell: "zou" },
{ name: "孟", spell: "meng" },
{ name: "熊", spell: "xiong" },
{ name: "秦", spell: "qin" },
{ name: "邱", spell: "qiu" },
{ name: "江", spell: "jiang" },
{ name: "尹", spell: "yin" },
{ name: "薛", spell: "xue" },
{ name: "闫", spell: "yan" },
{ name: "段", spell: "duan" },
{ name: "雷", spell: "lei" },
{ name: "侯", spell: "hou" },
{ name: "龙", spell: "long" },
{ name: "史", spell: "shi" },
{ name: "陶", spell: "tao" },
{ name: "黎", spell: "li" },
{ name: "贺", spell: "he" },
{ name: "顾", spell: "gu" },
{ name: "毛", spell: "mao" },
{ name: "郝", spell: "hao" },
{ name: "龚", spell: "gong" },
{ name: "邵", spell: "shao" },
{ name: "万", spell: "dao" },
{ name: "钱", spell: "qian" },
{ name: "严", spell: "yan" },
{ name: "覃", spell: "tan" },
{ name: "武", spell: "wu" },
{ name: "戴", spell: "dai" },
{ name: "莫", spell: "mo" },
{ name: "孔", spell: "kong" },
{ name: "向", spell: "xiang" },
{ name: "汤", spell: "tang" }
];

        $(function () {

            $("#txbcustomerName").autocomplete(stockInfoJson, {
                minChars: 0,
                matchCase: false, //不区分大小写
                autoFill: true,
                max: 20,
                delay: 0,
                scroll: true,
                scrollHeight: 300,
                formatItem: function (row, i, max, term) {
                    var v = $("#txbcustomerName").val();
                    return row.name;
                    if (row.spell.indexOf(v) == 0) {
                        return row.name;
                    }
                    else
                        return false;
                },
                formatMatch: function (row, i, max) {
                    return row.name
                },
                formatResult: function (row) {
                    return row.name;
                },
                reasultSearch: function (row, v)//本场数据自定义查询语法
                {
                    //自定义在code或spell中匹配
                    if (row.data.spell.indexOf(v) == 0) {
                        return row;
                    }
                    else
                        return false;
                }
            });
        });
 

    </script>
   
</head>
<body style="overflow-x: hidden">
    <form id="form1" runat="server">
    <div>
        <table width="100%" class="tableBorder" border='1' cellspacing="0" style="border-collapse: collapse;"
            bgcolor="#ffffff" bordercolor="#cccccc">
            <tr align="center" valign="middle">
                <th height="22" colspan="3">
                    客 户 来 电 快 速 记 录
                </th>
            </tr>
            <tr>
                <td width="100px">
                    来电号码
                </td>
                <td colspan="2">
                    <asp:Literal runat="server" ID="litTargets"></asp:Literal>&nbsp;&nbsp;&nbsp;&nbsp;
                    客户信息：
                    <asp:Literal runat="server" ID="litCustormInfo"></asp:Literal>
                </td>
            </tr>
            <asp:Panel runat="server" ID="plop">
                <tr>
                    <td>
                        客户名称
                    </td>
                    <td colspan="2">
                        <asp:TextBox runat="server" ID="txbcustomerName" Width="60px" title='header=[说明] body=[单击下面的姓氏或者输入首字母]'></asp:TextBox>
                        <input type="radio" name="ddlsex" id="Radio1" value="男" <%=(Sex)?"checked":"" %> />先生
                        <input type="radio" name="ddlsex" id="Radio2" value="女" <%=(!Sex)?"checked":"" %> />女士
                        手机<asp:TextBox runat="server" ID="txbCustomerTel0" Width="100px"></asp:TextBox>
                        固话<asp:TextBox runat="server" ID="txbCustomerlandline0"></asp:TextBox>
                        客户级别
                        <asp:DropDownList runat="server" ID="ddlcg">
                        </asp:DropDownList>
                        <br />
                        <div id="namer" style="background-color: #FFE6D9">
                            姓氏: <span>王</span> <span>李</span> <span>张</span> <span>刘</span> <span>陈</span> <span>
                                杨</span> <span>黄</span> <span>赵</span> <span>吴</span> <span>周</span> <span>徐</span>
                            <span>孙</span> <span>马</span> <span>朱</span> <span>胡</span> <span>郭</span> <span>何</span>
                            <span>高</span> <span>林</span> <span>郑</span> <span>谢</span> <span>罗</span> <span>梁</span>
                            <span>宋</span> <span>唐</span> <span>许</span> <span>韩</span> <span>冯</span> <span>邓</span>
                            <span>曹</span> <span>彭</span> <span>曾</span> <span>肖</span> <span>田</span> <span>董</span>
                            <span>袁</span> <span>潘</span> <span>于</span> <span>蒋</span> <span>蔡</span> <span>余</span>
                            <span>杜</span> <span>叶</span> <span>程</span> <span>苏</span> <span>魏</span> <span>吕</span>
                            <span>丁</span>
                            <%--<span>任</span> <span>沈</span> <span>姚</span> <span>卢</span> <span>姜</span> <span>崔</span>
                            <span>钟</span> <span>谭</span> <span>陆</span> <span>汪</span> <span>范</span> <span>金</span>
                            <span>石</span> <span>廖</span> <span>贾</span> <span>夏</span> <span>韦</span> <span>付</span>
                            <span>方</span> <span>白</span> <span>邹</span> <span>孟</span> <span>熊</span> <span>秦</span>
                            <span>邱</span> <span>江</span> <span>尹</span> <span>薛</span> <span>闫</span> <span>段</span>
                            <span>雷</span> <span>侯</span> <span>龙</span> <span>史</span> <span>陶</span> <span>黎</span>
                            <span>贺</span> <span>顾</span> <span>毛</span> <span>郝</span> <span>龚</span> <span>邵</span>
                            <span>万</span> <span>钱</span> <span>严</span> <span>覃</span> <span>武</span> <span>戴</span>
                            <span>莫</span> <span>孔</span> <span>向</span> <span>汤</span>--%>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        单位
                    </td>
                    <td colspan="2">
                        <asp:TextBox runat="server" ID="txbcustomerWork" Width="60%"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        备注说明
                    </td>
                    <td colspan="2">
                        <asp:TextBox runat="server" ID="txbmemo" Width="60%" Height="50px" TextMode="MultiLine"></asp:TextBox>
                    </td>
                </tr>
            </asp:Panel>
            <tr valign="top">
                <td>
                    模版
                </td>
                <td>
                    <div id="smstmp">
                        <asp:Literal runat="server" ID="litsms"></asp:Literal>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    预定短信<br>
                    <asp:CheckBox runat="server" ID="ChkSendSms" Checked="true" />勾选发送
                </td>
                <td colspan="2">
                    <input type="button" id="MakeSMS" name="MakeSMS" class="btn" value="自动生成短信" /><span
                        id="info" style="display: none">请在下面输入您的文字：</span><br />
                    <asp:TextBox runat="server" ID="txbSMS" Width="60%" Height="80px" TextMode="MultiLine"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td colspan="2">
                    <asp:Button runat="server" ID="btnSaveCustomer" Text="仅保存客户信息" OnClick="btnSaveCustomer_Click"
                        CssClass="btn" />
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:Button runat="server" ID="btnok" Text="保存信息并发送短信,完成预定" OnClick="btnok_Click"
                        CssClass="btn" />
                </td>
            </tr>
            <tr style="display:none">
                    <td>
                        hidden
                    </td>
                    <td colspan="2">
                        <asp:TextBox runat="server" ID="txbcustomerMeetAddress" Width="60%"></asp:TextBox>
                        <asp:TextBox runat="server" ID="txbcustomerAddress0" Width="60%"></asp:TextBox>
                    </td>
                </tr>
        </table>
    </div>
    </form>
</body>
</html>
